
//============================================================================
// Name        :
// Author      :
// Version     :
// Copyright   :
// Description :This program change The TCP window Scale and size.
//				in order to run on ubunto: sudo ./Thesis_window_changer -i <internal interface>
//				-e <external interface> -s <only sniffer mode > -p <this is youtube server ip>
//============================================================================
using namespace std;
#include <string.h>
#include "main.h"

int main(int argc, char *const argv[])
{

	char internalDevice[MAX_DEVICE_NAME] = {0};
	char externalDevice[MAX_DEVICE_NAME] = {0};
	int opt = 0;

	// Analyze user options
	while ((opt = getopt(argc, argv, "i:e:")) != -1)
	{
	   switch (opt) // opt - set user input to network device
	   {
		   case 'i':
			   // Internal device
			   strncpy(internalDevice, optarg, sizeof(internalDevice));
			   break;
		   case 'e':
			   // External device
			   strncpy(externalDevice, optarg, sizeof(externalDevice));
			   break;

		   default: /* '?' */
		   fprintf(stderr, "\nUsage:\n\t%s -i internalDevice -e externalDevice [-w (window size)] [-s (only sniffing)]\n",
					   argv[0]);
			   return 1;
	   }
	}

	if (0 == strlen(internalDevice) || 0 == strlen(externalDevice))
	{
		fprintf(stderr, "\n\nUsage: %s -i internalDevice -e externalDevice -f configurationFileName [-w (window size)] [-s (only sniffing)]\n\n",
					   argv[0]);
		return 1;
	}


	/*Start the program  algorithm.*/
	startDashSniffer(internalDevice, externalDevice);


	return 0;
}

